import { Component } from "react";

export default class Weeather extends Component{
    state = {
        isHot: true
    }
    render(){
        return (
            <h1 onClick={this.changeWeather}>今天的天气真{this.state.isHot ? '炎热' : '冷'}</h1>
        )
    }

    changeWeather = () => {
        this.setState({
            isHot: !this.state.isHot
        })
    }
}